DRAKHYSYS INFINITY TILESET WORKBENCH V4.8.8.23
STORY MAKER + SAFE STORY WORKSPACE

NEW TAB: STORY MAKER

GOAL
Create story content without writing directly into the live Baldur's Gate II installation.
The Story Maker stages all edits in its own project and generates a SAFE_INSTALL folder.

PROJECT STRUCTURE
<STORY_PROJECT>/
  story_project.json
  SOURCE/override/       reserved source archive
  WORK/override/         staged CRE/ARE/BCS resources being edited
  SCRIPTS/               editable BAF source
  DIALOGUES/             editable dialogue JSON source
  TEXT/drak.tlk          private Drakhysys text archive
  BACKUPS/               originals copied before staging
  SAFE_INSTALL/
    override/             reviewed CRE/ARE/DLG/BCS output
    drak.tlk              private text archive copy
    lang/en_US/dialog.tlk patched SAFE copy of the selected baseline dialog.tlk

CREATURES
- Scan .CRE files directly from the selected source override folder.
- STAGE + EDIT CREATURE copies the CRE into WORK/override first.
- The existing CRE editor is embedded in Story Maker.
- Stats, animation, scripts and opcodes remain editable.
- Assign the current Story Maker DLG to the staged CRE.
- Assign a Story Maker creature Override script to the staged CRE.
- The source/live CRE is never overwritten by Story Maker staging.

AREA / ACTORS
- Scan .ARE resources from the selected source override.
- STAGE + LOAD AREA copies the ARE into WORK/override before editing.
- Uses the established visual ARE actor editor.
- Add/edit/delete actor instances and their CRE resrefs, coordinates, facing,
  schedules, DLG and actor script fields.
- USE CURRENT STAGED CRE AS ACTOR TEMPLATE connects the Creature and ARE workflows.
- If <AREA>_PREVIEW.png is present, it is loaded automatically as the placement map.

DIALOGUE MAKER
- Create DLG V1 dialogues in the same interface.
- Multiple dialogue states.
- NPC text per state.
- State triggers.
- Multiple player replies per state.
- Reply trigger, action, GOTO state, or EXIT.
- Dialogue source is stored as editable .story.json.
- BUILD SAFE STORY creates real DLG V1 files.
- DLG writer was validated against the supplied AEEXTORT.DLG sample.

DRAK.TLK / DIALOG.TLK SAFETY
- The selected existing drak.tlk is preserved as the private Drakhysys text base.
- Story text is appended to the project copy of drak.tlk.
- The selected baseline dialog.tlk is NEVER overwritten by Story Maker.
- BUILD SAFE STORY rebuilds SAFE_INSTALL/lang/<language>/dialog.tlk from the selected
  baseline and appends the Story Maker block there.
- If the supplied drak.tlk block already exists inside the baseline dialog.tlk,
  it is detected and is not duplicated.
- The supplied current dialog.tlk + drak.tlk pair was used in the self-test.

INTERACTIONS / SCRIPTS
- Edit BAF scripts inside Story Maker.
- Save multiple BAF sources in the project.
- Interaction templates:
    AREA ENTER ONCE
    SPAWN CREATURE ONCE
    CREATURE SEES PLAYER -> DIALOGUE
    CREATURE DEAD -> SET GLOBAL
    CUSTOM TRIGGER + ACTION
- Compile BAF -> BCS using the existing Near Infinity Java bridge.
- Story Maker uses the selected chitin.key and NearInfinity.jar.
- Compiled BCS files are written into WORK/override and then SAFE_INSTALL/override.
- The selected ARE's Area Script resref is patched only in the safe output.

SAFE BUILD
BUILD SAFE STORY commits the currently open staged CRE and ARE, saves dialogue and
BAF source, compiles available scripts, generates DLG resources, builds the private
project drak.tlk, creates a patched SAFE dialog.tlk copy and assembles SAFE_INSTALL.

Nothing is copied into the real BG2 override or lang folder automatically.
The user performs final installation only after reviewing SAFE_INSTALL.

VALIDATION
- Python syntax compilation: PASS
- Supplied AEEXTORT.DLG parsing: PASS (10 states / 14 transitions)
- New DLG writer/parser test: PASS
- Supplied DR0001.ARE area-script patch test: PASS
- Supplied real dialog.tlk + drak.tlk safe merge test: PASS
- Existing BAM resizer self-test: PASS
- Existing creature animation creator self-test: PASS
- Existing creature factory self-test: PASS
- GUI runtime could not be launched in the build container because PySide6 is not
  installed there; all GUI Python modules were syntax-compiled successfully.
